import 'package:flutter/material.dart';

import 'package:date_time_picker/date_time_picker.dart';
import 'package:flutter_web_study/utils/toast_utils.dart';

///@Description 审核页面
///@systemUser HXC182
///@Author Nine Tailed Fox
///@Date 2023/1/13 18:42

class ToExaminePage extends StatefulWidget {
  const ToExaminePage({Key? key}) : super(key: key);

  @override
  State<ToExaminePage> createState() => _ToExaminePageState();
}

class _ToExaminePageState extends State<ToExaminePage>
    with TickerProviderStateMixin {
  TabController? _tabController;

  List<Tab> tabs = <Tab>[
    Tab(text: '审核'),
    Tab(text: '未审核'),
    Tab(text: '已审核'),
  ];

  @override
  void initState() {
    super.initState();
    _tabController = TabController(length: tabs.length, vsync: this);
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          title: Text("甜甜圈审核"),
          centerTitle: true,
          actions: [
            IconButton(
                onPressed: () {
                  ToastUtils.showToast(msg: "点击了");
                  getData();
                },
                icon: Icon(Icons.access_time_outlined))
          ],
          bottom: TabBar(controller: _tabController, tabs: tabs)),
      body: TabBarView(
        controller: _tabController,
        children: [
          Text("审核"),
          Text("未审核"),
          Text("已审核"),
        ],
      ),
    );
  }

  void getData() {
    // DateTimePicker(
    //   type: DateTimePickerType.dateTimeSeparate,
    //   dateMask: 'YYYY-MM-DD',
    //   initialValue: DateTime.now().toString(),
    //   firstDate: DateTime(2000),
    //   lastDate: DateTime(2100),
    //   icon: Icon(Icons.event),
    //   dateLabelText: 'Date',
    //   timeLabelText: "Hour",
    //   selectableDayPredicate: (date) {
    //     // Disable weekend days to select from the calendar
    //     if (date.weekday == 6 || date.weekday == 7) {
    //       return false;
    //     }
    //
    //     return true;
    //   },
    //   onChanged: (val) => print(val),
    //   validator: (val) {
    //     print(val);
    //     return null;
    //   },
    //   onSaved: (val) => print(val),
    // );

  }
}
